<?php
class User_Model_Role extends Zen_Tree {

	public function __construct() {
		$table = new Zend_Db_Table ( 'user_roletree' );
		$this->table = $table;
		$types = array (
					'root' => array (
										'icon' => '/cms/res/icons/drive.png',
										'label' => 'Роли',
										'valid_children' => array ('role'),
										'start_drag' => false,
										'move_node' => false,
										'delete_node' => false,
										'remove' => false
									),
					'role' => array (
										'table' => 'user_role',
										'form' => 'User_Form_Role',
										'label' => 'роль',
										'view' => 'form.phtml',
										'icon' => '/cms/res/icons/text_list_bullets.png',
										'valid_children' => array('none'),
										'start_drag' => true,
										'move_node' => true,
										'delete_node' => true,
										'remove' => true
									)

		);

		$this->setTypes ( $types );
	}
	public function afterChange(){
		Cache_Model_Clear::clear('acl');
		$acl=Zen_Acl::getInstance();
	}

}